<template>
  <div class="category">
    <Header :isFixed="isFixed"></Header>
    <div class="container" :class="isFixed ? 'mgtop' : ''">
      <div class="row">
        <div class="col-md-2">
          <ListGroup :data="menuData" title="ListA"></ListGroup>
          <ListGroup :data="menuData" title="ListB"></ListGroup>
        </div>
        <div class="col-md-10">
          <div class="container_title">
            <TitleControl title="List" desc="Product List" className="slot">
              <div class="title_item">
                <DropDown :data="filterData"></DropDown>
              </div>
            </TitleControl>
          </div>
          <div class="container_tags">
            <TagsControl :data="tagsData"></TagsControl>
          </div>
          <div class="container_title">
            <TitleControl
              title="32 results found"
              className="small"
            ></TitleControl>
          </div>
          <div class="container_list">
            <ListControl :data="listData"></ListControl>
          </div>
        </div>
      </div>
      <Pagination :data="listData"></Pagination>
      <div class="container_aboutme">
        <AboutMeControl></AboutMeControl>
      </div>
    </div>
    <Footer></Footer>
  </div>
</template>

<script>
export default {
  name: "Category",
  props: {
    isFixed: {
      type: Boolean,
      default() {
        return false;
      },
    },
  },
  data() {
    return {
      menuData: [],
      tagsData: [],
      listData: [],
      filterData: [],
    };
  },
  components: {
    Header: () =>
      import(
        /* webpackChunkName:'header' */ "@/components/header/components/index.vue"
      ),
    Footer: () =>
      import(
        /* webpackChunkName:'footer' */ "@/components/footer/components/index.vue"
      ),
    AboutMeControl: () =>
      import(
        /* webpackChunkName:'aboutMeControl' */ "@/components/aboutMeControl/components/index.vue"
      ),
    DropDown: () =>
      import(
        /* webpackChunkName:'dropdown' */ "@/components/dropdown/components/index.vue"
      ),
    TagsControl: () =>
      import(
        /* webpackChunkName:'tagsControl' */ "@/components/tagsControl/components/index.vue"
      ),
    TitleControl: () =>
      import(
        /* webpackChunkName:'titleControl' */ "@/components/titleControl/components/index.vue"
      ),
    Pagination: () =>
      import(
        /* webpackChunkName:'pagination' */ "@/components/pagination/components/index.vue"
      ),
    ListControl: () =>
      import(
        /* webpackChunkName:'listControl' */ "@/components/listControl/components/index.vue"
      ),
    ListGroup: () =>
      import(
        /* webpackChunkName:'listGroup' */ "@/components/listGroup/components/index.vue"
      ),
  },
  created() {
    let arr = [];
    for (let i = 0; i < 5; i++)
      arr.push({
        name: i,
        path: "/search/:key",
        params: {
          key: i,
        },
      });
    this.menuData = [...arr];

    let tagArr = [];
    for (let i = 0; i < 5; i++)
      tagArr.push({
        tag: "Tag-" + i,
        path: "/search/:key",
        params: {
          key: i,
        },
      });
    this.tagsData = [...tagArr];

    let filterArr = [];
    for (let i = 0; i < 5; i++)
      filterArr.push({
        name: "Option" + i,
        value: i,
      });
    this.filterData = [...filterArr];

    let listArr = [];
    for (let i = 0; i < 9; i++)
      listArr.push({
        name: i,
        desc: "Detailed Description of Card Content.",
        path: "/categrory/detail/:id",
        params: { id: i },
      });
    this.listData = [...listArr];
  },
};
</script>

<style lang="scss">
.category {
  .container {
    padding: 0.625rem 0.9375rem;
    &.mgtop {
      margin-top: 3.5rem;
    }
    .es-list-group-title {
      font-size: 0.5rem;
      font-weight: 700;
    }
    .container_title {
    }
    .container_tags {
    }
    .container_list {
      padding: 0 0 2rem 0;
      overflow: hidden;
      .large {
        padding: 0.3125rem 0;
        float: left;
        width: 33.33%;
      }
      .small {
        padding: 0;
        margin: 0.625rem 0;
      }
      .es-card {
        border: 0;
        .es-img {
          background-color: var(--dark-light);
        }
        a {
          &.img_view {
            .hover-element {
              visibility: hidden;
              opacity: 0;
              -webkit-transition: all 0.3s ease-in-out;
              transition: all 0.3s ease-in-out;
              z-index: 9;
              top: 0;
              left: 0;
              right: 0;
              bottom: 0;
              border-top-left-radius: 0.25rem;
              border-top-right-radius: 0.25rem;
            }
            &:hover {
              .hover-element {
                visibility: visible;
                opacity: 1;
                background-color: rgba(0, 0, 0, 0.5);
                display: flex;
                justify-content: center;
                align-items: center;
                i {
                  color: #fff;
                  font-size: 2rem;
                }
              }
            }
          }
        }
      }
    }
    .container_aboutme {
    }
  }
}
</style>
